//
//  MineTableViewCell.m
//  ZJControlsClass
//
//  Created by mac on 2024/11/24.
//

#import "MineTableViewCell.h"

@interface MineTableViewCell ()


@property (nonatomic,strong) UIImageView * rightImg;
@property (nonatomic,strong) UIView * v;

@end


@implementation MineTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self){
        
        
        [self configUI];
        
        
    }
    return self;
}



-(void)configUI{
    
    [self.contentView addSubview:self.img];
    [self.contentView addSubview:self.msgLabel];
    [self.contentView addSubview:self.rightImg];
    [self.contentView addSubview:self.v];
    
    [self.img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.left.equalTo(self.contentView).with.offset(ALIGN_WIDTH_PT(27.5));
        make.size.equalTo(@(CGSizeMake(ALIGN_WIDTH_PT(22), ALIGN_WIDTH_PT(22))));
    }];
    
    [self.msgLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.img.mas_centerY);
        make.left.equalTo(self.img.mas_right).with.offset(ALIGN_WIDTH_PT(10));
    }];
    
    [self.rightImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.img.mas_centerY);
        make.right.equalTo(self.contentView).with.offset(-ALIGN_WIDTH_PT(27.5));
        make.size.equalTo(@(CGSizeMake(ALIGN_WIDTH_PT(8), ALIGN_HEIGHT_PT(12))));
    }];
    [self.v mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.img.mas_left);
        make.bottom.equalTo(self.contentView.mas_bottom);
        make.right.equalTo(self.rightImg.mas_right);
        make.height.equalTo(@(1));
    }];
    
    
}





#pragma mark -- 懒加载
-(UIImageView *)img{
    if (!_img){
        _img = [UIImageView new];
    }
    return _img;
}

-(UILabel *)msgLabel{
    if(!_msgLabel){
        _msgLabel = [UILabel new];
        _msgLabel.font = FONT14;
        _msgLabel.textColor = [UIColor blackColor];
        _msgLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _msgLabel;
}

-(UIImageView *)rightImg{
    if (!_rightImg){
        _rightImg = [UIImageView new];
        _rightImg.image = [UIImage imageNamed:@"向右箭头"];
    }
    return _rightImg;
}

-(UIView *)v{
    if (!_v){
        _v = [UIView new];
        _v.backgroundColor = COLOR_RGB(230, 230, 230);
    }
    return _v;
}


@end
